import request from '@/utils/request'
const api_name = '/ucenter/admin/admins'

export function login(data) {
  return request({
    url: `${api_name}/login`,
    method: 'post',
    data
  })
}

export function logout(data) {
  return request({
    url: `${api_name}/logout`,
    method: 'post',
    data
  })
}

export function getInfo() {
  return request({
    url: `${api_name}/verify`,
    method: 'get',
  })
}

export function getUserPageList(page,limit,data) {
  return request({
    url: `/manage/admin/users/${page}/${limit}`,
    method: 'get',
    params: data
  })
}

export function updateUserStatus(id,status) {
  return request({
    url: `/manage/admin/users/${id}/${status}`,
    method: 'put'
  })
}

export function getUserById(id) {
  return request({
    url: `/manage/admin/users/${id}`,
    method: 'get'
  })
}

export function updateUserById(id,data) {
  return request({
    url: `/manage/admin/users/${id}`,
    method: 'put',
    data
  })
}

export function updatePassword (id,data) {
  return request({
    url: `${api_name}/${id}`,
    method: 'put',
    data
  })
}


